package com.candy.ob;

import java.io.Serializable;

/**
 * @author donglin
 * @Title:
 * @类名: Student
 * @date 2020/7/21
 */
public class Student implements Serializable {
//序列化版本号，建议显示声明
    private static final long serialVersionUID=1L;

//属性
    private int stuAge;
    private transient String stuName;
    private boolean stuSex;
//无参构造
    public Student() {
    }
//全参构造
    public Student(int stuAge, String stuName, boolean stuSex) {
        this.stuAge = stuAge;
        this.stuName = stuName;
        this.stuSex = stuSex;
    }
//行为方法
    public void sayHi(){
        System.out.println("大家好");
    }
//getter setter方法
    public int getStuAge() {
        return stuAge;
    }

    public void setStuAge(int stuAge) {
        this.stuAge = stuAge;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public boolean isStuSex() {
        return stuSex;
    }

    public void setStuSex(boolean stuSex) {
        this.stuSex = stuSex;
    }

    @Override
    public String toString() {
        return "Student{" +
                "stuAge=" + stuAge +
                ", stuName='" + stuName + '\'' +
                ", stuSex=" + stuSex +
                '}';
    }
}
